
[#include "single/layout/layout02/layout.ftl"/]
[@htmlHead]

[/@htmlHead]

[@htmlBody]
<div class="row">
    <div class="col-xs-12">
        <ul class="nav nav-tabs ">
            <li><a href="${base}/role/view/index">角色列表</a></li>
            [#if "add"==operateType]
                <li class="active"><a href="javascript:void(0)">角色增加</a></li>
            [#else ]
                <li class="active"><a href="javascript:void(0)">角色修改</a></li>
            [/#if]

        </ul>
    </div>
</div>
<div class="row">
    <div class="col-xs-12">

        <form class="form-horizontal" action="${base}/role/view/update" method="post" id="editForm">
            <input type="hidden" name="id" id="id" value="${role.id}"/>
            <input type="hidden" name="isSys" id="isSys" value="${role.isSys}"/>
            <input type="hidden" name="operateType" id="operateType" value="${operateType}"/>
            <input type="hidden" name="checks"/>


            <div class="form-group">
                <label class="col-xs-10 col-sm-4 control-label "><span class="required">*</span>角色名称</label>

                <div class="col-xs-10 col-sm-4  ">
                    <input id="name" name="name" value="${role.name}"
                           class="form-control input-large"/>

                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-10 col-sm-4 control-label "><span class="required">*</span>角色编码</label>

                <div class="col-xs-10 col-sm-4  ">
                    <input id="enname" name="enname" value="${role.enname}"
                           class="form-control input-large"/>
                </div>
            </div>

            [#--<div class="form-group">--]
                [#--<label class="col-xs-10 col-sm-4 control-label "><span class="required">*</span>所属系统</label>--]

                [#--<div class="col-xs-10 col-sm-4  ">--]
                    [#--<div class="input-group input-large">--]
                        [#--<input id="appName" name="appName"  value="${app.appName}" placeholder="" readonly class="form-control "/>--]
                         [#--<span class="input-group-btn" onclick="component.app.choose('选择系统','appKey','appName',null)">--]
                                [#--<button type="button" class="btn  blue"><i class="fa fa-search"></i></button>--]
                            [#--</span>--]
                        [#--<input id="appKey" name="appKey" value="${app.appNameCode}" type="hidden"/>--]
                    [#--</div>--]
                    [#--</div>--]
            [#--</div>--]


            <div class="form-group">
                <div id="editAlert" class="" style="min-width:550px"></div>
                <label class="col-xs-10 col-sm-4 control-label ">是否启用</label>

                <div class="col-xs-10 col-sm-4  ">
                    <div class="btn-group" role="group">
                    [#if role.isEnabled=='0']
                        <button class="btn btn-sm" type="button" value="1">启用</button>
                        <button class="btn btn-success btn-sm"  type="button" value="0">禁用</button>
                        <input type="hidden" name="isEnabled" value="0"/>
                    [#else]
                        <button class="btn btn-success btn-sm" type="button" value="1">启用</button>
                        <button class="btn btn-sm" type="button" value="0">禁用</button>
                        <input type="hidden" name="isEnabled" value="1"/>
                    [/#if]
                        </div>

                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-10 col-sm-4 control-label ">角色描述</label>

                <div class="col-xs-10 col-sm-4  ">
                    <textarea class="form-control input-large" name="description" id="description"
                              style="text-align: left;">${role.description}</textarea>
                </div>
            </div>

        </form>

    </div>
</div>
<div class="ice-header edit-ice-header"></div>
<div class="row">
    <div class="col-xs-10 col-sm-4"></div>
    <div class="col-xs-10 col-sm-4 ">
        <ul id="treeView" class="ztree"></ul>
    </div>
</div>



<div class="form-group">
    <label class=" col-xs-10 col-sm-4  control-label"></label>
    <div class="col-xs-10 col-sm-4 " align="center">
        <input type="button" class="btn btn-info btn-sm" value="确定" onclick="doSubmit('${operateType}')"/>
        <input type="button" onclick="tools.goto('${base}/role/view/index')" class="btn btn-cancle btn-sm" value="返回"/>
    </div>
</div>
[/@htmlBody]

[@htmlFoot]
    [#include "common/validate.ftl"/]
<script src="${jpath}/assets/public/plugins/dialog/bootbox.js" type="text/javascript"></script>
<script src="${base}/plugins/single/js/module/role/role.js" type="text/javascript"></script>
[#--<script src="${base}/resources/component/organization/org.js" type="text/javascript"></script>--]
<script type="text/javascript" src="${base}/plugins/single/js/module/app/app-component.js"></script>
<!-- ztree-->
<link href="${jpath}/assets/public/plugins/jquery-ztree/3.5.12/css/zTreeStyle/zTreeStyle.min.css" rel="stylesheet"
      type="text/css"/>
<script type="text/javascript"
        src="${jpath}/assets/public/plugins/jquery-ztree/3.5.12/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript">
    $(function () {
        viewRes();//显示资源
    });

</script>

[/@htmlFoot]